package com.vegetable.modules.service.outbound;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.vegetable.common.utils.PageUtils;
import com.vegetable.modules.entity.outbound.SalesOutDetail;
import com.vegetable.modules.entity.outbound.po.DeductionAddPO;
import com.vegetable.modules.entity.outbound.po.DeductionQueryPO;
import com.vegetable.modules.entity.outbound.po.SalesOutSequencePO;
import com.vegetable.modules.entity.outbound.vo.DeductionVO;
import com.vegetable.modules.entity.outbound.vo.SalesOutDetailVO;

import java.util.List;

/**
 * <p>
 * 销售出库单 服务类
 * </p>
 *
 * @author wangruijie
 * @since 2024-04-01
 */
public interface ISalesOutDetailService extends IService<SalesOutDetail> {

    /**
     * 销售总表列表查询
     * @param params
     * @return
     */
    PageUtils sequenceToDetail(SalesOutSequencePO po);

    void completeDetail(List<SalesOutDetailVO> records);

    List<SalesOutDetail> selectBySalesId(Long mainId);

    /**
     * 批量查询销售出库单明细
     * @param salesIds 销售出库单ID列表
     * @return 明细列表
     */
    List<SalesOutDetail> selectBySalesIds(List<Long> salesIds);

    /**
     * 批量查询销售出库单明细（仅统计字段，性能优化版）
     * @param salesIds 销售出库单ID列表
     * @return 仅包含统计所需字段的明细列表
     */
    List<SalesOutDetail> selectBySalesIdsForStatistics(List<Long> salesIds);

    /**
     * 分页查询扣款列表
     * @param po
     * @return
     */
    IPage<DeductionVO> deductionList(DeductionQueryPO po);

    void deductionAdd(List<DeductionAddPO> pos);

    void deductionDel(Long id);

    void deductionUp(DeductionAddPO po);
}
